{template 'common/header'}
{if $if_link_wxapp}
	<div class="media media-wechat-setting">
		<div class="media-left color-default">
			<span class="wi wi-wxapp-webpack" style="font-size: 55px;"></span>
		</div>
		<div class="media-body media-middle ">
			<h4 class="media-heading color-dark">{$module['title']}</h4>
			<div class="color-gray">版本: v{$version_info['version']}</div>
		</div>
		{if getenv('LOCAL_DEVELOP')}
		<div class="media-right media-middle">
			<span class="color-gray">授权上传功能在本地开发模式下不支持；在 <a href="javascript:openUrl('https://dev.w7.cc')" class="color-default">开发者中心</a> 发布后可用。</span>
		</div>
		{/if}
		<div class="media-right media-middle">
			<a href="{php echo url('wxapp/front-download/getpackage', ['module_name' => $module_name, 'version_id' => $version_id])}" class="btn btn-primary">立即下载</a>
			{if !empty($_W['setting']['server_setting']['app_id'])}
			<a href="javascript:;" class="btn btn-primary" onclick="authorizationUpload()" {if getenv('LOCAL_DEVELOP')}disabled="1"{/if}>授权上传</a>
			{/if}
		</div>
	</div>
	<script>
		function authorizationUpload() {
			window.w7.ready(()=>{
				window.w7.navigate({
					modulename: '{php echo CARD_NAVIGATE_MODULE_NAME}',
					type: 'micro',
					route: '{php echo $upload_route}',
					title: '上传小程序',
					style: {width:1000, height:700},
				});
			})
		}
	</script>
	<style>
		.img img{width: 250px;height: auto;}
	</style>
	<div class="wxapp-download-procedure">
		<div class="title color-gray">小程序前端下载后操作流程说明：</div>
		<div class="step">1.进入微信小程序后台（mp.weixin.qq.com），添加小程序开发者（如已经是管理员或开发者则不需要添加）</div>
		<div class="img">
			<img src="./resource/images/wxapp/01.png" alt=""/>
			<img src="./resource/images/wxapp/02.png" alt=""/>
		</div>
		<div class="step">2.进入小程序后台。点击开发管理/开发设置，修改服务器域名（设置自己的微擎域名，<span class="color-red">必须是https</span>）</div>
		<div class="img">
			<img src="./resource/images/wxapp/03.png" alt=""/>
			<img src="./resource/images/wxapp/04.png" alt=""/>
		</div>
		<div class="step">3.下载 <a href="javascript:openUrl('https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html')" class="color-default">微信开发者工具</a>，更新到最新版后（切记），将<span class="color-red">下载解压后的小程序导入</span>，填写小程序appid
		</div>
		<div class="img">
			<img src="./resource/images/wxapp/05.png" alt=""/>
			<img src="./resource/images/wxapp/06.png" alt=""/>
		</div>
		<div class="step">4.点击上传，并设置更新类型和版本号</div>
		<div class="img">
			<img src="./resource/images/wxapp/07.png" alt=""/>
			<img src="./resource/images/wxapp/08.png" alt=""/>
		</div>
		<div class="step">5.进入小程序后台（mp.weixin.qq.com），点击版本管理，提交审核，小程序<span class="color-red">管理员</span>（必须需要管理员扫描，小程序开发者不可）扫描即可
		</div>
		<div class="img">
			<img src="./resource/images/wxapp/09.png" alt=""/>
			<img src="./resource/images/wxapp/10.png" alt=""/>
		</div>
		<div class="step">6.微信官方审核通过即可使用</div>
	</div>
{else}
<div class="panel we7-panel panel-body">
	{if getenv('LOCAL_DEVELOP')}
	检测到未关联微信小程序，请先在 <span class="color-gray">data/init.accounts.php</span> 文件内配置微信小程序的初始化数据后重新安装。
	{else}
	检测到未关联微信小程序，请先在 <a class="color-default" href="{php echo $frames['section']['platform_module_common']['menu']['platform_module_welcome']['url']}">模块首页</a> 关联一个微信小程序类型的平台。
	{/if}
</div>
{/if}
{template 'common/footer'}
